The user usually interacts with the T system via a read-eval-print loop. As illustrated above, this is a command loop which repeatedly reads an expression, evaluates it, and prints the value.
The read-eval-print loop is a simple command processor; it prints a prompt, reads a command from the terminal, executes the command, then prints another prompt, ad infinitum. A command is any executable T form, and executing the command consists of evaluating the form and printing the result.
Expressions are read from the terminal by applying the READ
operation (actually, the value of (REPL-READ); see page
) to the terminal input port. Initially, that
port's read table is the standard read table, but this may be changed
using SET, for example:
Evaluation is performed with respect to a particular variable environment and its syntax table. The read-eval-print loop may move from place to place within the environment hierarchy; one may control the evaluation environment and syntax table by setting (REPL-ENV).